Option Strict On
Option Explicit On 

Public Class UDetail
    Inherits System.Windows.Forms.UserControl

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents uclAlternatingBackColor As Avand.UColor
    Friend WithEvents uclSelectionBackColor As Avand.UColor
    Friend WithEvents cboNewPage As System.Windows.Forms.ComboBox
    Friend WithEvents lblNewPage As System.Windows.Forms.Label
    Friend WithEvents chkKeepTogether As System.Windows.Forms.CheckBox
    Friend WithEvents chkPrintBackGround As System.Windows.Forms.CheckBox
    Friend WithEvents uclSelectionForeColor As Avand.UColor
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(UDetail))
        Me.uclAlternatingBackColor = New Avand.UColor
        Me.uclSelectionBackColor = New Avand.UColor
        Me.cboNewPage = New System.Windows.Forms.ComboBox
        Me.lblNewPage = New System.Windows.Forms.Label
        Me.chkKeepTogether = New System.Windows.Forms.CheckBox
        Me.chkPrintBackGround = New System.Windows.Forms.CheckBox
        Me.uclSelectionForeColor = New Avand.UColor
        Me.SuspendLayout()
        '
        'uclAlternatingBackColor
        '
        Me.uclAlternatingBackColor.AccessibleDescription = resources.GetString("uclAlternatingBackColor.AccessibleDescription")
        Me.uclAlternatingBackColor.AccessibleName = resources.GetString("uclAlternatingBackColor.AccessibleName")
        Me.uclAlternatingBackColor.Anchor = CType(resources.GetObject("uclAlternatingBackColor.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.uclAlternatingBackColor.AutoScroll = CType(resources.GetObject("uclAlternatingBackColor.AutoScroll"), Boolean)
        Me.uclAlternatingBackColor.AutoScrollMargin = CType(resources.GetObject("uclAlternatingBackColor.AutoScrollMargin"), System.Drawing.Size)
        Me.uclAlternatingBackColor.AutoScrollMinSize = CType(resources.GetObject("uclAlternatingBackColor.AutoScrollMinSize"), System.Drawing.Size)
        Me.uclAlternatingBackColor.BackgroundImage = CType(resources.GetObject("uclAlternatingBackColor.BackgroundImage"), System.Drawing.Image)
        Me.uclAlternatingBackColor.Caption = resources.GetString("uclAlternatingBackColor.Caption")
        Me.uclAlternatingBackColor.Color = System.Drawing.SystemColors.Control
        Me.uclAlternatingBackColor.Dock = CType(resources.GetObject("uclAlternatingBackColor.Dock"), System.Windows.Forms.DockStyle)
        Me.uclAlternatingBackColor.Enabled = CType(resources.GetObject("uclAlternatingBackColor.Enabled"), Boolean)
        Me.uclAlternatingBackColor.Font = CType(resources.GetObject("uclAlternatingBackColor.Font"), System.Drawing.Font)
        Me.uclAlternatingBackColor.ImeMode = CType(resources.GetObject("uclAlternatingBackColor.ImeMode"), System.Windows.Forms.ImeMode)
        Me.uclAlternatingBackColor.Location = CType(resources.GetObject("uclAlternatingBackColor.Location"), System.Drawing.Point)
        Me.uclAlternatingBackColor.Name = "uclAlternatingBackColor"
        Me.uclAlternatingBackColor.RightToLeft = CType(resources.GetObject("uclAlternatingBackColor.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.uclAlternatingBackColor.Size = CType(resources.GetObject("uclAlternatingBackColor.Size"), System.Drawing.Size)
        Me.uclAlternatingBackColor.TabIndex = CType(resources.GetObject("uclAlternatingBackColor.TabIndex"), Integer)
        Me.uclAlternatingBackColor.Visible = CType(resources.GetObject("uclAlternatingBackColor.Visible"), Boolean)
        '
        'uclSelectionBackColor
        '
        Me.uclSelectionBackColor.AccessibleDescription = resources.GetString("uclSelectionBackColor.AccessibleDescription")
        Me.uclSelectionBackColor.AccessibleName = resources.GetString("uclSelectionBackColor.AccessibleName")
        Me.uclSelectionBackColor.Anchor = CType(resources.GetObject("uclSelectionBackColor.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.uclSelectionBackColor.AutoScroll = CType(resources.GetObject("uclSelectionBackColor.AutoScroll"), Boolean)
        Me.uclSelectionBackColor.AutoScrollMargin = CType(resources.GetObject("uclSelectionBackColor.AutoScrollMargin"), System.Drawing.Size)
        Me.uclSelectionBackColor.AutoScrollMinSize = CType(resources.GetObject("uclSelectionBackColor.AutoScrollMinSize"), System.Drawing.Size)
        Me.uclSelectionBackColor.BackgroundImage = CType(resources.GetObject("uclSelectionBackColor.BackgroundImage"), System.Drawing.Image)
        Me.uclSelectionBackColor.Caption = resources.GetString("uclSelectionBackColor.Caption")
        Me.uclSelectionBackColor.Color = System.Drawing.SystemColors.Control
        Me.uclSelectionBackColor.Dock = CType(resources.GetObject("uclSelectionBackColor.Dock"), System.Windows.Forms.DockStyle)
        Me.uclSelectionBackColor.Enabled = CType(resources.GetObject("uclSelectionBackColor.Enabled"), Boolean)
        Me.uclSelectionBackColor.Font = CType(resources.GetObject("uclSelectionBackColor.Font"), System.Drawing.Font)
        Me.uclSelectionBackColor.ImeMode = CType(resources.GetObject("uclSelectionBackColor.ImeMode"), System.Windows.Forms.ImeMode)
        Me.uclSelectionBackColor.Location = CType(resources.GetObject("uclSelectionBackColor.Location"), System.Drawing.Point)
        Me.uclSelectionBackColor.Name = "uclSelectionBackColor"
        Me.uclSelectionBackColor.RightToLeft = CType(resources.GetObject("uclSelectionBackColor.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.uclSelectionBackColor.Size = CType(resources.GetObject("uclSelectionBackColor.Size"), System.Drawing.Size)
        Me.uclSelectionBackColor.TabIndex = CType(resources.GetObject("uclSelectionBackColor.TabIndex"), Integer)
        Me.uclSelectionBackColor.Visible = CType(resources.GetObject("uclSelectionBackColor.Visible"), Boolean)
        '
        'cboNewPage
        '
        Me.cboNewPage.AccessibleDescription = resources.GetString("cboNewPage.AccessibleDescription")
        Me.cboNewPage.AccessibleName = resources.GetString("cboNewPage.AccessibleName")
        Me.cboNewPage.Anchor = CType(resources.GetObject("cboNewPage.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.cboNewPage.BackColor = System.Drawing.SystemColors.Window
        Me.cboNewPage.BackgroundImage = CType(resources.GetObject("cboNewPage.BackgroundImage"), System.Drawing.Image)
        Me.cboNewPage.Dock = CType(resources.GetObject("cboNewPage.Dock"), System.Windows.Forms.DockStyle)
        Me.cboNewPage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboNewPage.Enabled = CType(resources.GetObject("cboNewPage.Enabled"), Boolean)
        Me.cboNewPage.Font = CType(resources.GetObject("cboNewPage.Font"), System.Drawing.Font)
        Me.cboNewPage.ImeMode = CType(resources.GetObject("cboNewPage.ImeMode"), System.Windows.Forms.ImeMode)
        Me.cboNewPage.IntegralHeight = CType(resources.GetObject("cboNewPage.IntegralHeight"), Boolean)
        Me.cboNewPage.ItemHeight = CType(resources.GetObject("cboNewPage.ItemHeight"), Integer)
        Me.cboNewPage.Location = CType(resources.GetObject("cboNewPage.Location"), System.Drawing.Point)
        Me.cboNewPage.MaxDropDownItems = CType(resources.GetObject("cboNewPage.MaxDropDownItems"), Integer)
        Me.cboNewPage.MaxLength = CType(resources.GetObject("cboNewPage.MaxLength"), Integer)
        Me.cboNewPage.Name = "cboNewPage"
        Me.cboNewPage.RightToLeft = CType(resources.GetObject("cboNewPage.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.cboNewPage.Size = CType(resources.GetObject("cboNewPage.Size"), System.Drawing.Size)
        Me.cboNewPage.TabIndex = CType(resources.GetObject("cboNewPage.TabIndex"), Integer)
        Me.cboNewPage.Text = resources.GetString("cboNewPage.Text")
        Me.cboNewPage.Visible = CType(resources.GetObject("cboNewPage.Visible"), Boolean)
        '
        'lblNewPage
        '
        Me.lblNewPage.AccessibleDescription = resources.GetString("lblNewPage.AccessibleDescription")
        Me.lblNewPage.AccessibleName = resources.GetString("lblNewPage.AccessibleName")
        Me.lblNewPage.Anchor = CType(resources.GetObject("lblNewPage.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.lblNewPage.AutoSize = CType(resources.GetObject("lblNewPage.AutoSize"), Boolean)
        Me.lblNewPage.Dock = CType(resources.GetObject("lblNewPage.Dock"), System.Windows.Forms.DockStyle)
        Me.lblNewPage.Enabled = CType(resources.GetObject("lblNewPage.Enabled"), Boolean)
        Me.lblNewPage.Font = CType(resources.GetObject("lblNewPage.Font"), System.Drawing.Font)
        Me.lblNewPage.Image = CType(resources.GetObject("lblNewPage.Image"), System.Drawing.Image)
        Me.lblNewPage.ImageAlign = CType(resources.GetObject("lblNewPage.ImageAlign"), System.Drawing.ContentAlignment)
        Me.lblNewPage.ImageIndex = CType(resources.GetObject("lblNewPage.ImageIndex"), Integer)
        Me.lblNewPage.ImeMode = CType(resources.GetObject("lblNewPage.ImeMode"), System.Windows.Forms.ImeMode)
        Me.lblNewPage.Location = CType(resources.GetObject("lblNewPage.Location"), System.Drawing.Point)
        Me.lblNewPage.Name = "lblNewPage"
        Me.lblNewPage.RightToLeft = CType(resources.GetObject("lblNewPage.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.lblNewPage.Size = CType(resources.GetObject("lblNewPage.Size"), System.Drawing.Size)
        Me.lblNewPage.TabIndex = CType(resources.GetObject("lblNewPage.TabIndex"), Integer)
        Me.lblNewPage.Text = resources.GetString("lblNewPage.Text")
        Me.lblNewPage.TextAlign = CType(resources.GetObject("lblNewPage.TextAlign"), System.Drawing.ContentAlignment)
        Me.lblNewPage.Visible = CType(resources.GetObject("lblNewPage.Visible"), Boolean)
        '
        'chkKeepTogether
        '
        Me.chkKeepTogether.AccessibleDescription = resources.GetString("chkKeepTogether.AccessibleDescription")
        Me.chkKeepTogether.AccessibleName = resources.GetString("chkKeepTogether.AccessibleName")
        Me.chkKeepTogether.Anchor = CType(resources.GetObject("chkKeepTogether.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.chkKeepTogether.Appearance = CType(resources.GetObject("chkKeepTogether.Appearance"), System.Windows.Forms.Appearance)
        Me.chkKeepTogether.BackgroundImage = CType(resources.GetObject("chkKeepTogether.BackgroundImage"), System.Drawing.Image)
        Me.chkKeepTogether.CheckAlign = CType(resources.GetObject("chkKeepTogether.CheckAlign"), System.Drawing.ContentAlignment)
        Me.chkKeepTogether.Dock = CType(resources.GetObject("chkKeepTogether.Dock"), System.Windows.Forms.DockStyle)
        Me.chkKeepTogether.Enabled = CType(resources.GetObject("chkKeepTogether.Enabled"), Boolean)
        Me.chkKeepTogether.FlatStyle = CType(resources.GetObject("chkKeepTogether.FlatStyle"), System.Windows.Forms.FlatStyle)
        Me.chkKeepTogether.Font = CType(resources.GetObject("chkKeepTogether.Font"), System.Drawing.Font)
        Me.chkKeepTogether.Image = CType(resources.GetObject("chkKeepTogether.Image"), System.Drawing.Image)
        Me.chkKeepTogether.ImageAlign = CType(resources.GetObject("chkKeepTogether.ImageAlign"), System.Drawing.ContentAlignment)
        Me.chkKeepTogether.ImageIndex = CType(resources.GetObject("chkKeepTogether.ImageIndex"), Integer)
        Me.chkKeepTogether.ImeMode = CType(resources.GetObject("chkKeepTogether.ImeMode"), System.Windows.Forms.ImeMode)
        Me.chkKeepTogether.Location = CType(resources.GetObject("chkKeepTogether.Location"), System.Drawing.Point)
        Me.chkKeepTogether.Name = "chkKeepTogether"
        Me.chkKeepTogether.RightToLeft = CType(resources.GetObject("chkKeepTogether.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.chkKeepTogether.Size = CType(resources.GetObject("chkKeepTogether.Size"), System.Drawing.Size)
        Me.chkKeepTogether.TabIndex = CType(resources.GetObject("chkKeepTogether.TabIndex"), Integer)
        Me.chkKeepTogether.Text = resources.GetString("chkKeepTogether.Text")
        Me.chkKeepTogether.TextAlign = CType(resources.GetObject("chkKeepTogether.TextAlign"), System.Drawing.ContentAlignment)
        Me.chkKeepTogether.Visible = CType(resources.GetObject("chkKeepTogether.Visible"), Boolean)
        '
        'chkPrintBackGround
        '
        Me.chkPrintBackGround.AccessibleDescription = resources.GetString("chkPrintBackGround.AccessibleDescription")
        Me.chkPrintBackGround.AccessibleName = resources.GetString("chkPrintBackGround.AccessibleName")
        Me.chkPrintBackGround.Anchor = CType(resources.GetObject("chkPrintBackGround.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.chkPrintBackGround.Appearance = CType(resources.GetObject("chkPrintBackGround.Appearance"), System.Windows.Forms.Appearance)
        Me.chkPrintBackGround.BackgroundImage = CType(resources.GetObject("chkPrintBackGround.BackgroundImage"), System.Drawing.Image)
        Me.chkPrintBackGround.CheckAlign = CType(resources.GetObject("chkPrintBackGround.CheckAlign"), System.Drawing.ContentAlignment)
        Me.chkPrintBackGround.Dock = CType(resources.GetObject("chkPrintBackGround.Dock"), System.Windows.Forms.DockStyle)
        Me.chkPrintBackGround.Enabled = CType(resources.GetObject("chkPrintBackGround.Enabled"), Boolean)
        Me.chkPrintBackGround.FlatStyle = CType(resources.GetObject("chkPrintBackGround.FlatStyle"), System.Windows.Forms.FlatStyle)
        Me.chkPrintBackGround.Font = CType(resources.GetObject("chkPrintBackGround.Font"), System.Drawing.Font)
        Me.chkPrintBackGround.Image = CType(resources.GetObject("chkPrintBackGround.Image"), System.Drawing.Image)
        Me.chkPrintBackGround.ImageAlign = CType(resources.GetObject("chkPrintBackGround.ImageAlign"), System.Drawing.ContentAlignment)
        Me.chkPrintBackGround.ImageIndex = CType(resources.GetObject("chkPrintBackGround.ImageIndex"), Integer)
        Me.chkPrintBackGround.ImeMode = CType(resources.GetObject("chkPrintBackGround.ImeMode"), System.Windows.Forms.ImeMode)
        Me.chkPrintBackGround.Location = CType(resources.GetObject("chkPrintBackGround.Location"), System.Drawing.Point)
        Me.chkPrintBackGround.Name = "chkPrintBackGround"
        Me.chkPrintBackGround.RightToLeft = CType(resources.GetObject("chkPrintBackGround.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.chkPrintBackGround.Size = CType(resources.GetObject("chkPrintBackGround.Size"), System.Drawing.Size)
        Me.chkPrintBackGround.TabIndex = CType(resources.GetObject("chkPrintBackGround.TabIndex"), Integer)
        Me.chkPrintBackGround.Text = resources.GetString("chkPrintBackGround.Text")
        Me.chkPrintBackGround.TextAlign = CType(resources.GetObject("chkPrintBackGround.TextAlign"), System.Drawing.ContentAlignment)
        Me.chkPrintBackGround.Visible = CType(resources.GetObject("chkPrintBackGround.Visible"), Boolean)
        '
        'uclSelectionForeColor
        '
        Me.uclSelectionForeColor.AccessibleDescription = resources.GetString("uclSelectionForeColor.AccessibleDescription")
        Me.uclSelectionForeColor.AccessibleName = resources.GetString("uclSelectionForeColor.AccessibleName")
        Me.uclSelectionForeColor.Anchor = CType(resources.GetObject("uclSelectionForeColor.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.uclSelectionForeColor.AutoScroll = CType(resources.GetObject("uclSelectionForeColor.AutoScroll"), Boolean)
        Me.uclSelectionForeColor.AutoScrollMargin = CType(resources.GetObject("uclSelectionForeColor.AutoScrollMargin"), System.Drawing.Size)
        Me.uclSelectionForeColor.AutoScrollMinSize = CType(resources.GetObject("uclSelectionForeColor.AutoScrollMinSize"), System.Drawing.Size)
        Me.uclSelectionForeColor.BackgroundImage = CType(resources.GetObject("uclSelectionForeColor.BackgroundImage"), System.Drawing.Image)
        Me.uclSelectionForeColor.Caption = resources.GetString("uclSelectionForeColor.Caption")
        Me.uclSelectionForeColor.Color = System.Drawing.SystemColors.ControlText
        Me.uclSelectionForeColor.Dock = CType(resources.GetObject("uclSelectionForeColor.Dock"), System.Windows.Forms.DockStyle)
        Me.uclSelectionForeColor.Enabled = CType(resources.GetObject("uclSelectionForeColor.Enabled"), Boolean)
        Me.uclSelectionForeColor.Font = CType(resources.GetObject("uclSelectionForeColor.Font"), System.Drawing.Font)
        Me.uclSelectionForeColor.ImeMode = CType(resources.GetObject("uclSelectionForeColor.ImeMode"), System.Windows.Forms.ImeMode)
        Me.uclSelectionForeColor.Location = CType(resources.GetObject("uclSelectionForeColor.Location"), System.Drawing.Point)
        Me.uclSelectionForeColor.Name = "uclSelectionForeColor"
        Me.uclSelectionForeColor.RightToLeft = CType(resources.GetObject("uclSelectionForeColor.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.uclSelectionForeColor.Size = CType(resources.GetObject("uclSelectionForeColor.Size"), System.Drawing.Size)
        Me.uclSelectionForeColor.TabIndex = CType(resources.GetObject("uclSelectionForeColor.TabIndex"), Integer)
        Me.uclSelectionForeColor.Visible = CType(resources.GetObject("uclSelectionForeColor.Visible"), Boolean)
        '
        'UDetail
        '
        Me.AccessibleDescription = resources.GetString("$this.AccessibleDescription")
        Me.AccessibleName = resources.GetString("$this.AccessibleName")
        Me.AutoScroll = CType(resources.GetObject("$this.AutoScroll"), Boolean)
        Me.AutoScrollMargin = CType(resources.GetObject("$this.AutoScrollMargin"), System.Drawing.Size)
        Me.AutoScrollMinSize = CType(resources.GetObject("$this.AutoScrollMinSize"), System.Drawing.Size)
        Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Image)
        Me.Controls.Add(Me.uclSelectionForeColor)
        Me.Controls.Add(Me.chkPrintBackGround)
        Me.Controls.Add(Me.chkKeepTogether)
        Me.Controls.Add(Me.cboNewPage)
        Me.Controls.Add(Me.lblNewPage)
        Me.Controls.Add(Me.uclSelectionBackColor)
        Me.Controls.Add(Me.uclAlternatingBackColor)
        Me.Enabled = CType(resources.GetObject("$this.Enabled"), Boolean)
        Me.Font = CType(resources.GetObject("$this.Font"), System.Drawing.Font)
        Me.ImeMode = CType(resources.GetObject("$this.ImeMode"), System.Windows.Forms.ImeMode)
        Me.Location = CType(resources.GetObject("$this.Location"), System.Drawing.Point)
        Me.Name = "UDetail"
        Me.RightToLeft = CType(resources.GetObject("$this.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.Size = CType(resources.GetObject("$this.Size"), System.Drawing.Size)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Public Event ValueChanged As EventHandler

    Private Sub UDetail_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        AddHandler uclAlternatingBackColor.ValueChanged, AddressOf OnValueChanged
        AddHandler uclSelectionBackColor.ValueChanged, AddressOf OnValueChanged
        AddHandler uclSelectionForeColor.ValueChanged, AddressOf OnValueChanged
        AddHandler cboNewPage.SelectionChangeCommitted, AddressOf OnValueChanged
        AddHandler chkKeepTogether.CheckedChanged, AddressOf OnValueChanged
        AddHandler chkPrintBackGround.CheckedChanged, AddressOf OnValueChanged
    End Sub

    Protected Sub OnValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        RaiseEvent ValueChanged(Me, New EventArgs)
    End Sub

    Public Sub Prepare()
        cboNewPage.Items.Clear()

        cboNewPage.Items.Clear()
        cboNewPage.Items.Add(Model10.NewPageMode.None)
        cboNewPage.Items.Add(Model10.NewPageMode.Before)
        cboNewPage.Items.Add(Model10.NewPageMode.After)
        cboNewPage.Items.Add(Model10.NewPageMode.BeforeAndAfter)
    End Sub

    Public Sub Read(ByVal detail As Model10.Detail)
        uclAlternatingBackColor.Color = detail.AlternatingBackColor
        uclSelectionBackColor.Color = detail.SelectionBackColor
        uclSelectionForeColor.Color = detail.SelectionForeColor
        cboNewPage.SelectedItem = detail.NewPage
        chkKeepTogether.Checked = detail.KeepTogether
        chkPrintBackGround.Checked = detail.PrintBackground
    End Sub
    Public Sub Write(ByVal detail As Model10.Detail)
        detail.AlternatingBackColor = uclAlternatingBackColor.Color
        detail.SelectionBackColor = uclSelectionBackColor.Color
        detail.SelectionForeColor = uclSelectionForeColor.Color
        detail.NewPage = CType(cboNewPage.SelectedItem, Model10.NewPageMode)
        detail.KeepTogether = chkKeepTogether.Checked
        detail.PrintBackground = chkPrintBackGround.Checked
    End Sub
End Class